<div class="form-cont" ng-switch on="vm.type">
    <form name="menuForm" class="form system-form-cont" novalidate ng-switch-when="menu">
        <div class="modal-header">
            <h4 class="modal-title" ng-if="!vm.isEdit">新增菜单</h4>
            <h4 class="modal-title" ng-if="vm.isEdit">编辑菜单</h4>
        </div>
        <div class="modal-body">
            <div class="form-group height-60">
                <label for="menuName">菜单名称<span class="require"></span></label>
                <input type="text" name="menuName" class="form-control" ng-model="vm.data.menuName" ng-blur="vm.checkValid(menuForm.menuName)" ng-class="{'error': menuForm.menuName.$invalid && !menuForm.menuName.$pristine}" id="menuName" placeholder="菜单名称" required/>
                <span class="error" ng-show="menuForm.menuName.$invalid && !menuForm.menuName.$pristine">菜单名称不能为空</span>
            </div>
            <div class="form-group height-60">
                <label for="urlAddr">菜单连接</label>
                <input type="text" name="urlAddr" class="form-control" ng-model="vm.data.urlAddr" id="urlAddr" placeholder="菜单连接"/>
            </div>
            <div class="form-group height-60">
                <label for="menuIndex">菜单权重<span class="require"></span></label>
                <input type="number" name="menuIndex" class="form-control" ng-model="vm.data.menuIndex" ng-pattern="/\d+/" ng-blur="vm.checkValid(menuForm.menuIndex)" ng-class="{'error': menuForm.menuIndex.$invalid || (menuForm.menuIndex.$modelValue < 0)}" id="menuIndex" required placeholder="菜单权重"/>
                <span class="error" ng-show="menuForm.menuIndex.$invalid || (menuForm.menuIndex.$modelValue < 0)">菜单权重只能是正整数</span>
            </div>
            <div class="form-group height-60">
                <label for="statusCd">菜单状态<span class="require"></span></label>
                <select name="statusCd" ng-model="vm.data.statusCd" ng-class="{'error':menuForm.statusCd.$invalid && !menuForm.statusCd.$pristine}" ng-options="k as v for (k, v) in vm.status" id="statusCd" required class="form-control" >
                    <option value="">请选菜单状态</option>
                </select>
                <span class="error" ng-show="menuForm.statusCd.$invalid && !menuForm.statusCd.$pristine">菜单状态不能为空</span>
            </div>
            <div class="form-group height-60">
                <label for="statusCd">菜单打开模式<span class="require"></span></label>
                <select name="openMode" ng-model="vm.data.openMode" ng-class="{'error':menuForm.openMode.$invalid && !menuForm.openMode.$pristine}" ng-options="k as v for (k, v) in vm.openMode" id="openMode" required class="form-control" >
                    <option value="">请选菜单打开模式</option>
                </select>
                <span class="error" ng-show="menuForm.openMode.$invalid && !menuForm.openMode.$pristine">菜单打开模式不能为空</span>
            </div>
            <div class="form-group">
                <label for="menuDesc">菜单描述</label>
                <textarea class="form-control" id="menuDesc" ng-model="vm.data.menuDesc" cols="30" rows="5" placeholder="菜单描述"></textarea>
            </div>
        </div>
        <div class="modal-footer">
            <button type="submit" class="btn btn-primary" ng-disabled="menuForm.$invalid || vm.isSame" ng-click="vm.save('menu')"><span ng-show="vm.submitting"><i class="fa fa-spinner fa-spin"></i></span>保存</button>
            <button ng-click="vm.cancel()" type="button" class="btn btn-default cancel">取消</button>
        </div>
    </form>
    <form name="compForm" class="form system-form-cont" novalidate ng-switch-when="comp">
        <div class="modal-header">
            <h4 class="modal-title" ng-if="!vm.isEdit">新增控件</h4>
            <h4 class="modal-title" ng-if="vm.isEdit">编辑控件</h4>
        </div>
        <div class="modal-body">
            <div class="form-group height-60">
                <label for="compName">控件名称<span class="require"></span></label>
                <input type="text" name="compName" class="form-control" ng-model="vm.data.compName" ng-keyup="vm.checkSame('comp')" ng-blur="vm.checkValid(compForm.compName)"  ng-class="{'error': compForm.compName.$invalid && !compForm.compName.$pristine}" id="compName" placeholder="控件名称" required />
                <span class="error" ng-show="compForm.compName.$invalid && !compForm.compName.$pristine">控件名称不能为空</span>
            </div>
            <div class="form-group height-60">
                <label for="selectValue">权限标识<span class="require"></span></label>
                <input type="text" name="selectValue" class="form-control" ng-model="vm.data.selectValue" ng-blur="vm.checkValid(compForm.selectValue)"  ng-class="{'error': compForm.selectValue.$invalid && !compForm.selectValue.$pristine}" id="selectValue" placeholder="权限标识,用于权限控制" required />
                <span class="error" ng-show="compForm.selectValue.$invalid && !compForm.selectValue.$error.pattern  && !compForm.selectValue.$pristine">权限标识不能为空</span>
            </div>
            <div class="form-group height-60">
                <label for="urlAddr">控件链接<span class="require"></span></label>
                <input type="text" name="urlAddr" class="form-control" ng-model="vm.data.urlAddr" ng-blur="vm.checkValid(compForm.urlAddr)" ng-class="{'error': compForm.urlAddr.$invalid && !compForm.urlAddr.$pristine}" id="urlAddr" placeholder="控件链接" required />
                <span class="error" ng-show="compForm.urlAddr.$invalid && !compForm.urlAddr.$pristine">控件链接不能为空</span>
            </div>
            <div class="form-group height-60">
                <label for="statusCd">控件状态<span class="require"></span></label>
                <select name="statusCd" ng-model="vm.data.statusCd" ng-class="{'error':compForm.statusCd.$invalid && !compForm.statusCd.$pristine}" ng-options="k as v for (k, v) in vm.status" id="statusCd" required class="form-control" >
                    <option value="">请选控件状态</option>
                </select>
                <span class="error" ng-show="compForm.statusCd.$invalid && !compForm.statusCd.$pristine">组织状态不能为空</span>
            </div>
            <div class="form-group">
                <label for="compDesc">控件描述</label>
                <textarea class="form-control" name="compDesc" id="compDesc" ng-model="vm.data.compDesc" cols="30" rows="5" placeholder="控件描述"></textarea>
            </div>
        </div>
        <div class="modal-footer">
            <button type="submit" class="btn btn-primary" ng-click="vm.save('comp')" ng-disabled="compForm.$invalid || vm.isSame"><span ng-show="vm.submitting"><i class="fa fa-spinner fa-spin"></i></span>保存</button>
            <button ng-click="vm.cancel()" type="button" class="btn btn-default cancel">取消</button>
        </div>
    </form>
</div>